class A:
    name = 'wuyutao'
    age = 18

    def func1(self):
        print('func1 is called')

class B:
    pass

def play_car():
    print('play car')

if __name__ == '__main__':
    obj = A()

    setattr(obj, 'love', play_car)

    obj.love()
    obj.func1()